package tag30_21_08.collection;

//Collections:

	//Motivation?
		//Arrays sind statisch: Anzahl der Elemente ist von anfang an fest gelegt



public class Test {

	public static void main(String[] args) {
		Punkt p1 = new Punkt(2,3);
		Punkt p2 = new Punkt(2,3);
		Punkt p4 = new Punkt(12, 13);
		Punkt p3 = p2;
		
		Circle c1 = new Circle(2, p1);
		Circle c2 = new Circle(2, p1);
		
		
		System.out.println(p1 == p2);
		System.out.println(p3 == p2);
		System.out.println(p1.equals(p2));
		System.out.println(c1 == c2);
		System.out.println(c1.equals(c2));
		System.out.println(c1);
		System.out.println(c2);
		System.out.println(p1);
		System.out.println(p2);
		System.out.println(p3);
		System.out.println(p4);
		
		
	}
}

class Circle {
	int radius;
	Punkt mp;

	public Circle(int radius, Punkt mp) {
		this.radius = radius;
		this.mp = mp;
	}

	public int getRadius() {
		return radius;
	}

	public void setRadius(int radius) {
		this.radius = radius;
	}

	public Punkt getMp() {
		return mp;
	}

	public void setMp(Punkt mp) {
		this.mp = mp;
	}
	
	

}

class Punkt {
	int x;
	int y;

	public Punkt(int x, int y) {
		super();
		this.x = x;
		this.y = y;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + x;
		result = prime * result + y;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Punkt other = (Punkt) obj;
		if (x != other.x)
			return false;
		if (y != other.y)
			return false;
		return true;
	}

}